package collection;



import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;

public class SortPoint {
    public static void main(String[] args) {
        List<Point> list=new ArrayList<>();
        list.add(new Point(5,8));

        list.sort(new Comparator<Point>() {
            @Override
            public int compare(Point o1, Point o2) {
                return o1.getA()-o2.getB();

            }
        });
        System.out.println();

    }
//使用list.sort()方法直接使用compare比较器


}
